<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>pod</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th bgcolor="#70b0f0" class="navbar-select"
          >&nbsp;&nbsp;&nbsp;Home&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="https://code.google.com/p/py-pod/">py-pod</a></th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        Package&nbsp;pod
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="pod-module.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<!-- ==================== PACKAGE DESCRIPTION ==================== -->
<h1 class="epydoc">Package pod</h1><p class="nomargin-top"><span class="codelink"><a href="pod-pysrc.html">source&nbsp;code</a></span></p>
<p>Framework for performing a Proper Orthogonal Decomposition (POD).</p>
  <p>Useful references:</p>
  <ul>
    <li>
      http://en.wikipedia.org/wiki/Homogeneous_coordinates
    </li>
    <li>
      
      http://en.wikipedia.org/wiki/Transformation_matrix#Affine_transformations
    </li>
  </ul>
  <p>Usage example:</p>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span><span class="py-keyword">import</span> pod
<span class="py-prompt">&gt;&gt;&gt; </span>refs = [ [-4.0, -1.0],
<span class="py-prompt">&gt;&gt;&gt; </span>         [-2.0, -1.0],
<span class="py-prompt">&gt;&gt;&gt; </span>         [3.0, 4.0] ]
<span class="py-prompt">&gt;&gt;&gt; </span>target = [-2.0, 1.5]
<span class="py-prompt">&gt;&gt;&gt; </span>decomposition = pod.decompose(target, refs, epsilon=1E-6, max_iter=90)
<span class="py-prompt">&gt;&gt;&gt; </span><span class="py-keyword">print</span> decomposition.get_decomposition()
<span class="py-output">[-1.9999991745134178, 1.4999993808850638]</span>
<span class="py-output"></span><span class="py-prompt">&gt;&gt;&gt; </span><span class="py-keyword">print</span> decomposition.get_reference_weights()
<span class="py-output">[0.96153806466991254, 0.0, 0.61538436138874408]</span></pre>
  <p>The example above shows the reconstruction of the target using 3 
  reference signals, from which only reference 1 and reference 3 are useful
  (reference 2 is assigned a weight of 0).</p>

<hr />
<div class="fields">      <p><strong>Author:</strong>
        Christophe Alexandre &lt;ch.alexandre at bluewin dot ch&gt;
      </p>
      <p><strong>License:</strong>
        Copyright(C) 2010 Christophe Alexandre
        <p>This program is free software: you can redistribute it and/or 
        modify it under the terms of the GNU Lesser General Public License 
        as published by the Free Software Foundation, either version 3 of 
        the License, or (at your option) any later version.</p>
        <p>This program is distributed in the hope that it will be useful, 
        but WITHOUT ANY WARRANTY; without even the implied warranty of 
        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
        General Public License for more details.</p>
        <p>You should have received a copy of the GNU Lesser General Public
        License along with this program.  If not, see 
        &lt;http://www.gnu.org/licenses/lgpl.txt&gt;.</p>
      </p>
</div><!-- ==================== SUBMODULES ==================== -->
<a name="section-Submodules"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td align="left" colspan="2" class="table-header">
    <span class="table-header">Submodules</span></td>
</tr>
  <tr><td class="summary">
  <ul class="nomargin">
    <li class="private"> <strong class="uidlink"><a href="pod.linalg-module.html" onclick="show_private();">pod.linalg</a></strong>: <em class="summary">Basic linear algebra components and functions.</em>    </li>
    <li class="private"> <strong class="uidlink"><a href="pod.util-module.html" onclick="show_private();">pod.util</a></strong>: <em class="summary">Operations on matrices and various tools.</em>    </li>
    <li class="private"> <strong class="uidlink"><a href="pod.vecspace-module.html" onclick="show_private();">pod.vecspace</a></strong>: <em class="summary">Toolbox for handling projections onto linear varieties.</em>    </li>
  </ul></td></tr>
</table>

<br />
<!-- ==================== CLASSES ==================== -->
<a name="section-Classes"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td align="left" colspan="2" class="table-header">
    <span class="table-header">Classes</span></td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="pod.DecompositionBasic-class.html" class="summary-name">DecompositionBasic</a>
    </td>
  </tr>
</table>
<!-- ==================== FUNCTIONS ==================== -->
<a name="section-Functions"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td align="left" colspan="2" class="table-header">
    <span class="table-header">Functions</span></td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="pod-module.html#combined_distance" class="summary-sig-name">combined_distance</a>(<span class="summary-sig-arg">generator_weight</span>)</span><br />
      Distance function used for ordering the projections.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="pod-pysrc.html#combined_distance">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">IterativeDecomposition</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="pod-module.html#decompose" class="summary-sig-name">decompose</a>(<span class="summary-sig-arg">source</span>,
        <span class="summary-sig-arg">references</span>,
        <span class="summary-sig-arg">epsilon</span>=<span class="summary-sig-default">1e-010</span>,
        <span class="summary-sig-arg">max_iter</span>=<span class="summary-sig-default">20</span>,
        <span class="summary-sig-arg">max_factors</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">max_weight</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">distance</span>=<span class="summary-sig-default">&lt;function func at 0x00CCFC70&gt;</span>)</span><br />
      Decomposing the source using the proposed reference points.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="pod-pysrc.html#decompose">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
</table>
<!-- ==================== FUNCTION DETAILS ==================== -->
<a name="section-FunctionDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td align="left" colspan="2" class="table-header">
    <span class="table-header">Function Details</span></td>
</tr>
</table>
<a name="combined_distance"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">combined_distance</span>(<span class="sig-arg">generator_weight</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="pod-pysrc.html#combined_distance">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Distance function used for ordering the projections.</p>
  <p>A weight of 0.0 defines the distance to the projected point, while a 
  weight of 1.0 defines the distance relative to the point generating the 
  line.</p>
  <p>At each iteration step the current point is projected onto the closest
  of all lines.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>generator_weight</code></strong> (float usually in range [0.0, 1.0]) - how much weight is assigned to the generator point</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="decompose"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">decompose</span>(<span class="sig-arg">source</span>,
        <span class="sig-arg">references</span>,
        <span class="sig-arg">epsilon</span>=<span class="sig-default">1e-010</span>,
        <span class="sig-arg">max_iter</span>=<span class="sig-default">20</span>,
        <span class="sig-arg">max_factors</span>=<span class="sig-default">None</span>,
        <span class="sig-arg">max_weight</span>=<span class="sig-default">None</span>,
        <span class="sig-arg">distance</span>=<span class="sig-default">&lt;function func at 0x00CCFC70&gt;</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="pod-pysrc.html#decompose">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Decomposing the source using the proposed reference points.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>source</code></strong> (list) - input point</li>
        <li><strong class="pname"><code>references</code></strong> (list) - list of reference points</li>
        <li><strong class="pname"><code>epsilon</code></strong> (float) - limit of the error sequence for stopping iteration</li>
        <li><strong class="pname"><code>max_iter</code></strong> (int) - safeguard for stopping iteration</li>
        <li><strong class="pname"><code>max_factors</code></strong> (int) - limit for the number of reference points, None allowing to use 
          all of them</li>
        <li><strong class="pname"><code>distance</code></strong> (a function of start point, projected point, generator point) - function used for finding the closest line to project on</li>
    </ul></dd>
    <dt>Returns: IterativeDecomposition</dt>
        <dd>decomposition details</dd>
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th bgcolor="#70b0f0" class="navbar-select"
          >&nbsp;&nbsp;&nbsp;Home&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="https://code.google.com/p/py-pod/">py-pod</a></th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Thu Aug 04 16:36:46 2011
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
